package com.ftg.learn.springboot.brand.mapper;

import org.apache.ibatis.jdbc.SQL;

public class BaseUserProvider {

	public String selectUserById(){
		return new SQL(){{
			SELECT("cid,binfo,enjoy,c.bid,bname,COUNT(c.`bid`) COUNT,pls,bwebsite");
			FROM("brand b RIGHT JOIN COMMENT c ON b.bid=c.bid LEFT JOIN (SELECT bid,COUNT(bid) pls FROM COMMENT GROUP BY bid) d ON c.bid=d.bid ");
			WHERE("c.star > 3.5");
			GROUP_BY("c.bid");
			ORDER_BY("COUNT DESC LIMIT 3");
		}}.toString();
	}

}
